package com.haier.npt.security.resource;

import java.util.List;

import javax.validation.Valid;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.haier.npt.common.JsonResult;
import com.haier.npt.security.domain.SysApp;

/**
 * SysApp接口
 *
 * @author lixu
 */
public interface SysAppResource {

    /**
     * 添加一个app
     *
     * @param sysApp
     * @return
     */
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public JsonResult<SysApp> addApp(@RequestBody @Valid SysApp sysApp);

    /**
     * 更新一个app
     *
     * @param sysApp
     * @return
     */
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public JsonResult<Boolean> updateApp(@RequestBody @Valid SysApp sysApp);

    /**
     * 获取数据库中的app
     *
     * @return
     */
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public JsonResult<List<SysApp>> listApps();

    /**
     * 验证appkey的有效性
     *
     * @param sysApp
     * @return
     */
    @RequestMapping(value = "/validate", method = RequestMethod.POST)
    public JsonResult<SysApp> valiteAppKey(@RequestBody SysApp sysApp);


}
